<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    
    <!-- recorder -->
    <script type="text/javascript" src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script><script type="text/javascript" src="https://unpkg.com/js-audio-recorder@1.0.7/dist/recorder.js"></script><script type="text/javascript" src="https://cdn.staticfile.org/lamejs/1.2.1/lame.min.js"></script>
    <title>088-移动端语音输入</title>
    <style>
      button {
        height: 44px;
        line-height: 1.2;
        text-align: center;
        border-radius: 2px;
        cursor: pointer;
        margin: 12px;
        padding: 12px 14px;
      }
      .success {
        color: #fff;
        background-color: #1989fa;
        border: 1px solid #1989fa;
      }
      .info {
        color: #fff;
        background-color: #07c160;
        border: 1px solid #07c160;
      }
      .danger {
        color: #fff;
        background-color: #ee0a24;
        border: 1px solid #ee0a24;
      }
    </style>
    <script type="module" crossorigin src="../../../../static/js/088-index.html-5179e270.js"></script>
    <link rel="modulepreload" crossorigin href="../../../../static/common/modulepreload-polyfill-3cfb730f.js">
  </head>

  <body>
    <div id="app">
      <h3>getUserMedia api必须以https协议访问，不然可能会报错，在手机微信浏览器里就会直接undefind</h3>
      <button class="success" @click="getPermission()">获取麦克风权限</button>
      <br />
      <button class="info" @click="startRecorder()">开始录音</button>
      <button class="info" @click="resumeRecorder()">继续录音</button>
      <button class="info" @click="pauseRecorder()">暂停录音</button>
      <button class="info" @click="stopRecorder()">结束录音</button>
      <br />
      <button class="success" @click="playRecorder()">录音播放</button>
      <button class="success" @click="pausePlayRecorder()">暂停录音播放</button>
      <button class="success" @click="resumePlayRecorder()">恢复录音播放</button>
      <button class="success" @click="stopPlayRecorder()">停止录音播放</button>
      <br />
      <button class="info" @click="getRecorder()">获取录音信息</button>
      <button class="info" @click="downPCM()">下载PCM</button>
      <button class="info" @click="downWAV()">下载WAV</button>
      <button class="info" @click="getMp3Data()">下载MP3</button>
      <br />
      <button class="danger" @click="destroyRecorder()">销毁录音</button>
    </div>
    
  </body>
</html>
